<?php

// +----------------------------------------------------------------------
// | EasyAdmin
// +----------------------------------------------------------------------
// | PHP交流群: 763822524
// +----------------------------------------------------------------------
// | 开源协议  https://mit-license.org
// +----------------------------------------------------------------------
// | github开源项目：https://github.com/zhongshaofa/EasyAdmin
// +----------------------------------------------------------------------

namespace app\model\api\ah;

use laytp\BaseModel;
use think\model\concern\SoftDelete;

class XmUser extends BaseModel
{
    use SoftDelete;
    public function checkUser($data){
        $info = $this->where("user_id",$data['user_id'])->field('id')->find();
        try {
            if(!empty($info)){
                $this->where('id',$info->id)->save($data);
            }else{
                $this->save($data);
            }
            return true;
        } catch (\Exception $exception) {
            var_dump($exception->getMessage());
//            return false;
        }

    }
}